package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.BulletinReceiveDao;
import cn.topevery.garden.entity.dto.BulletinReceiveDTO;
import cn.topevery.garden.entity.po.BulletinReceive;
import cn.topevery.garden.entity.po.BulletinReceive;
import cn.topevery.garden.entity.query.BulletinReceiveQuery;
import cn.topevery.garden.entity.vo.BulletinReceiveVO;

import hw.topevery.framework.db.entity.DataPager;
import hw.topevery.framework.db.base.BaseEntityDao;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;

/**
 * 公告接收对象
 */
@Service
public class BulletinReceiveLogic extends BaseLogic<BulletinReceive> {
    @Autowired
    BulletinReceiveDao bulletinReceiveDao;

    @Override
    public BaseEntityDao<BulletinReceive, Integer> getDao() {
        return bulletinReceiveDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<BulletinReceiveVO> listPage(BulletinReceiveQuery query) {
        return bulletinReceiveDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        bulletinReceiveDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param bulletinReceive 实体
     */
    public void saveOrUpdate(String userId, BulletinReceive bulletinReceive){
        bulletinReceiveDao.saveOrUpdate(userId,bulletinReceive);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public BulletinReceive getEntityByColumn(String key, String value) {
        return bulletinReceiveDao.getEntityByColumn(key, value);
    }
}
